/*
 * @Author: wangliang
 * @Date: 2018-04-27
 * @description: 基本信息 --> 联系方式
*/

import { apiHttp } from '../../../apiHttp';
import Api from '../../../../api/company/comContactController.api';
import { ComContactDto, OrderByIdDto, JsonResult } from '../../../../api/Interface';
export default {
    // 添加联系方式
    saveComContact: async (comContact: ComContactDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.saveComContact, comContact);
        return res;
    },
    // 获取联系方式列表
    getComContactByCompanyIdPage:  async (listId: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.getComContactByCompanyIdPage, {companyId: listId});
        return res;
    },
    // 编辑联系方式
    updateComContact: async (comContact: ComContactDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.updateComContact, comContact);
        return res;
    },
    // 删除联系方式
    deleteComContact: async (deleteId: number): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.deleteComContact, {id: deleteId});
        return res;
    },
    // 拖拽排序
    orderByComContact: async (OrderById: OrderByIdDto): Promise<JsonResult> => {
        const res: JsonResult = await apiHttp(Api.orderByComContact, OrderById);
        return res;
    },

};